FROM jenkins:latest

USER root

RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && apt-get update && apt-get install -yq nodejs build-essential
RUN npm install -g hexo-cli

RUN echo "Host *\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config

RUN git config --global user.email "yugsuo@gmail.com" && \
    git config --global user.name "Guangyu Suo"

# docker build -t jenkins .
# docker run -d -p 8080:8080 -p 50000:50000 -v jenkins_data:/var/jenkins_home jenkins
# After jenkins container is running, you should install ssh-agent jenkins plugin to
# inject your private key, so you can git pull and push
